<include file="public@header" />
</head>
<body>
<!--	<div class="wrap">-->
<!--		<ul class="nav nav-tabs">-->
<!--			<li ><a href="{:url('courseclass/index')}">列表</a></li>-->
<!--			<li class="active"><a >{:lang('EDIT')}</a></li>-->
<!--		</ul>-->
<!--		<form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('courseclass/editPost')}">-->
<!--            <div class="form-group">-->
<!--				<label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>名称</label>-->
<!--				<div class="col-md-6 col-sm-10">-->
<!--					<input type="text" class="form-control" id="input-name" name="name" value="{$data.name}">-->
<!--				</div>-->
<!--			</div>-->
<!--            -->
<!--            <div class="form-group">-->
<!--				<label for="input-user_login" class="col-sm-2 control-label"><span class="form-required">*</span>图标</label>-->
<!--				<div class="col-md-6 col-sm-10">-->
<!--					<input type="hidden" name="thumb" id="thumbnail" value="{$data['thumb']}">-->
<!--                    <a href="javascript:uploadOneImage('图片上传','#thumbnail');">-->
<!--                        <if condition="empty($data.thumb)">-->
<!--                        <img src="__TMPL__/public/assets/images/default-thumbnail.png"-->
<!--                                 id="thumbnail-preview"-->
<!--                                 style="cursor: pointer;max-width:100px;max-height:100px;"/>-->
<!--                        <else/>-->
<!--                        <img src="{:cmf_get_image_preview_url($data.thumb)}"-->
<!--                             id="thumbnail-preview"-->
<!--                             style="cursor: pointer;max-width:100px;max-height:100px;"/>-->
<!--                        </if>-->
<!--                    </a>-->
<!--                    <input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片"> 建议尺寸： 100 X 100-->
<!--				</div>-->
<!--			</div>-->

<!--            <div class="form-group">-->
<!--				<div class="col-sm-offset-2 col-sm-10">-->
<!--					<input type="hidden" name="id" value="{$data.id}" />-->
<!--					<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('EDIT')}</button>-->
<!--					<a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>-->
<!--				</div>-->
<!--			</div>-->

<!--		</form>-->
<!--	</div>-->

	<div class="layui-fluid">
		<form method="post" class="layui-form js-ajax-form margin-top-20" action="{:url('courseclass/editPost')}">
			<div class="layui-form-item">
				<label for="input-name" class="layui-form-label"><span class="form-required">*</span>名称</label>
				<div class="layui-input-block">
					<input type="text" class="layui-input" id="input-name" name="name" value="{$data.name}">
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label"><span class="form-required">*</span>图标</label>
				<div class="layui-input-block">
					<input type="hidden" name="thumb" id="thumbnail" value="{$data['thumb']}">
					<a href="javascript:uploadOneImage('图片上传','#thumbnail');">
						<if condition="empty($data.thumb)">
						<img src="__TMPL__/public/assets/images/default-thumbnail.png"
								 id="thumbnail-preview"
								 style="cursor: pointer;max-width:100px;max-height:100px;"/>
						<else/>
						<img src="{:cmf_get_image_preview_url($data.thumb)}"
							 id="thumbnail-preview"
							 style="cursor: pointer;max-width:100px;max-height:100px;"/>
						</if>
					</a>
					<div class="layui-col-md12" style="margin-top: 10px">
						<input type="button" class="layui-btn layui-btn-sm layui-btn-normal"
							   onclick="$('#thumbnail-preview').attr('src','__TMPL__/public/assets/images/default-thumbnail.png');$('#thumbnail').val('');return false;"
							   value="取消图片"> 建议尺寸： 100 X 100
					</div>
				</div>
			</div>


			<div class="layui-form-item">
				<div class="layui-input-block">
					<input type="hidden" name="id" value="{$data.id}" />
					<button type="submit" class="layui-btn js-ajax-submit">{:lang('SAVE')}</button>
					<a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
				</div>
			</div>

		</form>
	</div>



	<script src="__STATIC__/js/admin.js"></script>
	<script src="__STATIC__/js/wind.js"></script>

	<script>
        (function(){
            $('.btn-cancel-thumbnail').click(function () {
                $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
                $('#thumbnail').val('');
            });
        })()
    </script>
</body>
</html>
